<template>
  <rui-page :defines="defines">
    <Row class="auditClass">
      <Form ref="formAudit" :label-width="90" style="margin-top:-5px" inline>
        <div style="width: 15%;height: 45px;float: left;">
          <FormItem label="贷款期数:" :label-width="120">{{detailParams.loanTerm}}</FormItem>
        </div>
        <div style="width: 30%;height: 45px;float: left;">
          <FormItem label="产品型号:" :label-width="120">{{detailParams.gpsFullName}}</FormItem>
        </div>
        <div class="child-div">
          <FormItem label="合同车辆VIN号:" :label-width="120">{{detailParams.carVin}}</FormItem>
        </div>
        <div class="child-div">
          <FormItem label="设备车辆VIN号:" :label-width="120">{{detailParams.factoryVin}}</FormItem>
        </div>
      </Form>
    </Row><br>
    <rui-table :loading="loading" border :defineId="'gpsAuditDetail'" :showIndex="false" :select="false" :columns="columns" @loadDatas="queryData" ref-query="searchForm" ref="gpsTable" />
  </rui-page>
</template>
<script>
import gpsAuditDetailDefine from '../defines/loan-gps-audit-detail-define'
import { getGpsDeviceInfoList } from '_p/afs-core-business/api/afs-case/loan-gps-manage/loanGpsManage'
export default {
  name: 'gpsAuditDetail',
  props: {
    detailParams: {},
  },
  data() {
    return {
      loading: true,
      deviceCarVin: '',
      columns: [
        'gpsRunStatus',
        'busiType',
        'gpsDeviceNo',
        'gpsType',
        'createTime',
      ],
    }
  },
  computed: {
    defines() {
      return [
        {
          id: 'gpsAuditDetail',
          fields: gpsAuditDetailDefine,
        },
      ]
    },
  },
  methods: {
    queryData(queryData) {
      getGpsDeviceInfoList(this.detailParams).then((res) => {
        if (res.code === '0000') {
          let { records, total } = res.data
          this.$refs.gpsTable.updateTableData(records, total)
        }
      })
    },

    refresh() {
      this.$refs['gpsTable'].reloadData()
    },
  },

  mounted() {
    this.refresh()
  },
}
</script>
<style>
.auditClass {
  width: 99%;
  height: 100%;
}
.auditClass .child-div {
  width: 25%;
  height: 45px;
  float: left;
}
</style>